#!/bin/sh
# this script is used to start test automatically

# add this absulote path to ~/.bashrc to boot up

TOOL_NAME="sm2-fact-qc-mc/src/main.py"
CUR_DIR=$(cd $(dirname $0); pwd)

echo "Tool name: ${TOOL_NAME}"
echo "current directory: ${CUR_DIR}"

#ps aux | grep ${TOOL_NAME} | grep -v grep 2>&1 1>/dev/null
ps aux | grep ${TOOL_NAME} | grep -v grep

# check if test tool is started
if [ $? -ne 0 ]; then
    python3 "${CUR_DIR}/src/main.py" &
else
    echo "test tool is started"
fi
